Skip to content

Release v0.8.0#132

Merged
vlavrynovych merged 12 commits into
masterfrom
release/0.8.0
Dec 18, 2025
Merged

Release v0.8.0#132
vlavrynovych merged 12 commits into
masterfrom
release/0.8.0

Conversation

@vlavrynovych
Copy link
Copy Markdown
Member

Prometheus uses a pull model requiring long-running HTTP servers, which is incompatible with MSR's CLI-based ephemeral execution model.

Prometheus uses a pull model requiring long-running HTTP servers,
which is incompatible with MSR's CLI-based ephemeral execution model.
@vlavrynovych vlavrynovych added this to the v0.8.0 milestone Dec 16, 2025
@vlavrynovych vlavrynovych self-assigned this Dec 16, 2025
Updated docs/development/publishing.md to reflect tag-based automated
publishing workflow instead of manual npm publish commands.

Changes:
- Automated publishing via git tag push
- NPM_TOKEN secret management and renewal process
- Provenance verification steps
- Emergency manual publishing fallback
- Updated quick reference commands
Foundation for preventing concurrent migration execution in production
deployments (Kubernetes, CI/CD pipelines).

Added:
- ILockingService<DB> with two-phase locking protocol (acquire → verify)
- ILockStatus for CLI lock status queries
- LockingConfig with validation (timeout, retries, SQL injection protection)
- Config.locking property (default: enabled, 10min timeout, fail-fast)
- IDatabaseMigrationHandler.lockingService (optional, adapter-specific)
Added two-phase locking (acquire → verify → release) to MigrationWorkflowOrchestrator.
Wraps migrateAll() and migrateToVersion() with unique executor ID (hostname-pid-uuid).

Features: fail-fast default, retry logic, graceful degradation, always releases in finally.
Implemented lock:status and lock:release commands plus --no-lock flag.

New CLI commands:
- lock:status: Display current lock holder, timestamps, and expiration
- lock:release --force: Force-release stuck locks with confirmation prompt

New features:
- --no-lock flag: Disable locking for single migration run
- Public API methods: getLockStatus(), forceReleaseLock() on MigrationScriptExecutor
- flagMapper support for --no-lock mapping to config.locking.enabled

Safety features:
- Requires --force flag to release locks
- Interactive confirmation prompt before releasing
- Detailed warnings about dangers of force-releasing active locks
Added comprehensive documentation for lock management CLI commands.

Documentation:
- Created lock-commands.md guide for CLI lock operations
- Created locking-settings.md for configuration reference
- Updated comparison.md, ci-cd-integration.md, cli-vs-api.md,
  docker-kubernetes.md, production-deployment.md with locking info

Tests (to maintain 100% coverage):
- Added lock-status.test.ts, lock-release.test.ts, askForConfirmation.test.ts
- Refactored lock commands for testability via dependency injection
The test/fixtures/migrations/empty directory is required by integration
tests but was not tracked in git. Added .gitkeep to ensure directory
exists in CI environments.

Fixes CircleCI: "ENOENT: no such file or directory, scandir './test/fixtures/migrations/empty'"
…stem scripts

Fixed "TypeError: s.init is not a function" error when calling executor.down().

Root Cause:
- migrationScanner.scan() returns scripts.migrated as plain objects from DB
- Plain objects lack filepath property and init() method
- prepareRollbackScripts() tried to call init() on plain objects

Solution:
- Added matchMigratedWithScripts() helper to match DB records with filesystem
- Maps migrated records (plain objects) to MigrationScript instances (with filepath)
- Throws clear error if migration file is missing from filesystem

Changes:
- Added private matchMigratedWithScripts() method in MigrationRollbackManager
- Updated rollbackToVersion() to use matched scripts before calling init()
Added optional THandler generic parameter for type-safe handler access in adapters.

Changes:
- Added THandler generic with default IDatabaseMigrationHandler<DB>
- Updated MigrationScriptExecutor<DB, THandler> class signature
- Updated IMigrationExecutorDependencies<DB, THandler> interface
- Changed handler assignment to preserve type from dependencies
- Added comprehensive JSDoc with adapter usage examples

Benefits:
- Type-safe access to handler properties in adapter implementations
- Eliminates need for casting and bracket notation workarounds
- Backwards compatible - default type parameter maintains existing behavior
- Better IDE autocomplete for adapter-specific handler properties
Created comprehensive v0.7-to-v0.8 migration guide with feature documentation and examples.

Updated all documentation files:
- README.md and docs/index.md with v0.8.0 "What's New" sections
- Reorganized version migration index with "Current" and "Previous Releases"
- Updated API docs for lockingService and THandler generic parameter
- Updated guide docs with locking examples (production-deployment, cli-adapter-development)
- Enhanced comparison.md with detailed comparison tables for JS/TS and cross-platform tools
@sonarqubecloud
Copy link
Copy Markdown

@vlavrynovych vlavrynovych merged commit 1f32435 into master Dec 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant